package com.yuntian.controller.user;

import com.yuntian.Dto.CategoryPageQueryDto;
import com.yuntian.result.PageResult;
import com.yuntian.result.Result;
import com.yuntian.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userCategoryController")
@RequestMapping("/user/category")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    /**
     * 查询分类
     * @param
     * @return
     */
    @GetMapping("/list")
    public Result<PageResult> list(CategoryPageQueryDto categoryPageQueryDto) {
        PageResult list = categoryService.categoryList(categoryPageQueryDto);
        return Result.success(list);
    }
}
